From 93a9aafe96ecb28c4271adb1e227a49c343f1574 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 18 Jul 2008 15:44:39 +0100 Subject: [PATCH] mini-os is missing list_top in its list.h Signed-off-by: Keir Fraser --- extras/mini-os/include/list.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extras/mini-os/include/list.h b/extras/mini-os/include/list.h index 33a6d80f29..fbb1fa8cc0 100644 --- a/extras/mini-os/include/list.h +++ b/extras/mini-os/include/list.h @@ -24,6 +24,12 @@ struct list_head { (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while (0) +#define list_top(head, type, member) \ +({ \ + struct list_head *_head = (head); \ + list_empty(_head) ? NULL : list_entry(_head->next, type, member); \ +}) + /* * Insert a new entry between two known consecutive entries. * -- 2.30.2